package com.asiainfo.complier.ui;

import javax.swing.*;
import javax.swing.border.Border;
import java.awt.*;

public class JStatusBar extends JPanel {

	/**
	 * JStatusBar
	 */
	private static final long serialVersionUID = 4665338713557288324L;

	public JStatusBar() {
		setBorder(new Border() {

			public void paintBorder(Component c, Graphics g, int x, int y,
					int width, int height) {
				g.setColor(new Color(0x87, 0x8C, 0x8F));
				g.draw3DRect(x, y, width - 1, height - 1, true);

			}

			public boolean isBorderOpaque() {

				return false;
			}

			public Insets getBorderInsets(Component c) {

				return new Insets(1, 1, 1, 1);
			}
		});
	}

	@Override
	public void paint(Graphics g) {
		super.paint(g);
		g.setColor(new Color(0x87, 0x8C, 0x8F));
		int size = this.getComponents().length;
		for (int i = 0; i < size; i++) {
			Component c = this.getComponents()[i];
			int x = c.getLocation().x;

			g.drawLine(x, -1, x, getBounds().height + 1);
		}
	}
}
